Skip to content

Moved to one SubgraphManifest schema file per protocol #821

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

maoueh
Copy link
Contributor

@maoueh maoueh commented Jan 28, 2022

This will make it easier to add new network and will improve error messages when someone will be using fields that do not exist on a specific network but does in other (temlates for example used in NEAR were given a bunch of errors like the support was possible while it should have displayed an error on the templates node itself).

Using templates on NEAR before this PR:

✔ Apply migrations
✖ Failed to load subgraph from ../graph-node-dev/subgraphs/near/data-source/testnet.yaml: Error in ../graph-node-dev/subgraphs/near/data-source/testnet.yaml:

  Path: templates > 0 > source
  No value provided

  Path: templates > 0 > mapping
  Unexpected key in map: receiptHandlers

  Path: templates > 0 > mapping > abis
  No value provided

And with this PR:

$ ./bin/graph build ../graph-node-dev/subgraphs/near/data-source/testnet.yaml
✖ Failed to load subgraph from ../graph-node-dev/subgraphs/near/data-source/testnet.yaml: Error in ../graph-node-dev/subgraphs/near/data-source/testnet.yaml:

  Path: /
  Unexpected key in map: templates

@Jannis
Copy link
Contributor

Jannis commented Jan 28, 2022

One remark I have is that I can easily see Cross-Chain subgraphs becoming a thing and then the manifest would be a mix of data sources from different protocol.

@maoueh
Copy link
Contributor Author

maoueh commented Feb 3, 2022

Going to update all this today or tomorrow.

@maoueh
Copy link
Contributor Author

maoueh commented Feb 7, 2022

PR updated.

This will make it easier to add new network and will improve error messages when someone will be using fields that do not exist on a specific network but does in other (`temlates` for example used in NEAR were given a bunch of errors like the support was possible while it should have displayed an error on the `templates` node itself).

Using `templates` on NEAR before this PR:

```
✔ Apply migrations
✖ Failed to load subgraph from ../graph-node-dev/subgraphs/near/data-source/testnet.yaml: Error in ../graph-node-dev/subgraphs/near/data-source/testnet.yaml:

  Path: templates > 0 > source
  No value provided

  Path: templates > 0 > mapping
  Unexpected key in map: receiptHandlers

  Path: templates > 0 > mapping > abis
  No value provided
```

And with this PR:

```
$ ./bin/graph build ../graph-node-dev/subgraphs/near/data-source/testnet.yaml
✖ Failed to load subgraph from ../graph-node-dev/subgraphs/near/data-source/testnet.yaml: Error in ../graph-node-dev/subgraphs/near/data-source/testnet.yaml:

  Path: /
  Unexpected key in map: templates
```
@maoueh maoueh force-pushed the feature/schema-per-protocol branch from 8addafa to 00427b7 Compare February 7, 2022 15:49
@@ -9,6 +9,14 @@ describe('Validation', () => {
exitCode: 1,
},
)
cliTest(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yaaay!! 🎉

@evaporei evaporei merged commit 22f9a50 into graphprotocol:master Feb 8, 2022
@maoueh maoueh deleted the feature/schema-per-protocol branch February 8, 2022 20:22
@evaporei evaporei mentioned this pull request Feb 23, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants